<template>
  <div class="top">
    <div></div>
    <span>服务包管理</span>
  </div>
  <!-- 下拉菜单 -->

  <div class="xia_la">
    <div>
      <div class="span">服务包状态：</div>
      <el-select v-model="value" class="m-2" placeholder="请选择" size="large">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
    </div>
    <!-- 搜索 -->
    <div class="demo-input-suffix">
      <el-row :gutter="20" maxlength="400">
        <el-input
          v-model="input4"
          class="w-50 m-2"
          placeholder="请输入关键字"
          maxlength="400"
        >
          <template #suffix>
            <el-icon class="el-input__icon"><search /></el-icon>
          </template>
        </el-input>
      </el-row>
    </div>

    <!-- 新增按钮 -->
    <el-button type="primary" @click="toNewAddServicePackage">新增服务包</el-button>
  </div>

  <!-- 初级包 -->
  <div class="the_primary_package">
    <div class="container clearfix">
      <div class="left h1">{{ smallPackage[0].level }}</div>
      <div class="left" style="width: 100%">
        <div v-for="item in smallPackage" :key="item" class="sun">
          <img src="" alt="" />
          <div class="card_container">
            <div class="title">
              {{ item.title }}
              <span v-if="item.status === 1" style="color: #2984f8">
                已使用
              </span>
              <span v-if="item.status === 2" style="color: green">
                待审核
              </span>
              <span v-if="item.status === 3" style="color: #fddb78">
                已停用
              </span>
              <span v-if="item.status === 4" style="color: #fa746b">
                已驳回
              </span>
            </div>
            <div class="user">服务人群：{{ item.user }}</div>
            <div class="label">
              <div
                v-for="(span, index) in item.label"
                :key="index"
                class="left"
              >
                <span
                  v-if="span === '随访服务'"
                  style="
                    display: block;
                    background: #fee3e1;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >随访服务</span
                >
                <span
                  v-if="span === '常规护理'"
                  style="
                    display: block;
                    background: #d8f6ed;
                    height: 100%;
                    width: 100%;
                    color: #6adacb;
                  "
                  >常规护理</span
                >
                <span
                  v-if="span === '中医护理'"
                  style="
                    display: block;
                    background: #e2e4fd;
                    height: 100%;
                    width: 100%;
                    color: #6c76f4;
                  "
                  >中医护理</span
                >
                <span
                  v-if="span === '慢病管理'"
                  style="
                    display: block;
                    background: #fa746b;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >慢病管理</span
                >
                <span
                  v-if="span === '儿童护理'"
                  style="
                    display: block;
                    background: #fff8e4;
                    height: 100%;
                    width: 100%;
                    color: #fddb78;
                  "
                  >儿童护理</span
                >
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 中级包 -->

    <div class="container clearfix">
      <div class="left h1">{{ middlePackage[0].level }}</div>
      <div class="left" style="width: 100%">
        <div v-for="item in middlePackage" :key="item" class="sun">
          <img src="" alt="" />
          <div class="card_container">
            <div class="title">
              {{ item.title }}
              <span v-if="item.status === 1" style="color: #2984f8">
                已使用
              </span>
              <span v-if="item.status === 2" style="color: green">
                待审核
              </span>
              <span v-if="item.status === 3" style="color: #fddb78">
                已停用
              </span>
              <span v-if="item.status === 4" style="color: #fa746b">
                已驳回
              </span>
            </div>
            <div class="user">服务人群：{{ item.user }}</div>
            <div class="label">
              <div
                v-for="(span, index) in item.label"
                :key="index"
                class="left"
              >
                <span
                  v-if="span === '随访服务'"
                  style="
                    display: block;
                    background: #fee3e1;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >随访服务</span
                >
                <span
                  v-if="span === '常规护理'"
                  style="
                    display: block;
                    background: #d8f6ed;
                    height: 100%;
                    width: 100%;
                    color: #6adacb;
                  "
                  >常规护理</span
                >
                <span
                  v-if="span === '中医护理'"
                  style="
                    display: block;
                    background: #e2e4fd;
                    height: 100%;
                    width: 100%;
                    color: #6c76f4;
                  "
                  >中医护理</span
                >
                <span
                  v-if="span === '慢病管理'"
                  style="
                    display: block;
                    background: #fa746b;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >慢病管理</span
                >
                <span
                  v-if="span === '儿童护理'"
                  style="
                    display: block;
                    background: #fff8e4;
                    height: 100%;
                    width: 100%;
                    color: #fddb78;
                  "
                  >儿童护理</span
                >
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 高级报 -->
      <div class="container clearfix">
        <div class="left h1">{{ seniorPackage[0].level }}</div>
        <div v-for="item in seniorPackage" :key="item" class="sun">
          <img src="" alt="" />
          <div class="card_container">
            <div class="title">
              {{ item.title }}
              <span v-if="item.status === 1" style="color: #2984f8">
                已使用
              </span>
              <span v-if="item.status === 2" style="color: green">
                待审核
              </span>
              <span v-if="item.status === 3" style="color: #fddb78">
                已停用
              </span>
              <span v-if="item.status === 4" style="color: #fa746b">
                已驳回
              </span>
            </div>
            <div class="user">服务人群：{{ item.user }}</div>
            <div class="label">
              <div
                v-for="(span, index) in item.label"
                :key="index"
                class="left"
              >
                <span
                  v-if="span === '随访服务'"
                  style="
                    display: block;
                    background: #fee3e1;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >随访服务</span
                >
                <span
                  v-if="span === '常规护理'"
                  style="
                    display: block;
                    background: #d8f6ed;
                    height: 100%;
                    width: 100%;
                    color: #6adacb;
                  "
                  >常规护理</span
                >
                <span
                  v-if="span === '中医护理'"
                  style="
                    display: block;
                    background: #e2e4fd;
                    height: 100%;
                    width: 100%;
                    color: #6c76f4;
                  "
                  >中医护理</span
                >
                <span
                  v-if="span === '慢病管理'"
                  style="
                    display: block;
                    background: #fa746b;
                    height: 100%;
                    width: 100%;
                    color: #fa746b;
                  "
                  >慢病管理</span
                >
                <span
                  v-if="span === '儿童护理'"
                  style="
                    display: block;
                    background: #fff8e4;
                    height: 100%;
                    width: 100%;
                    color: #fddb78;
                  "
                  >儿童护理</span
                >
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 特需定制包 -->
      <div class="container clearfix">
        <div class="left h1">{{ specialPackage[0].level }}</div>
        <div class="left" style="width: 100%">
          <div v-for="item in specialPackage" :key="item" class="sun">
            <img src="" alt="" />
            <div class="card_container">
              <div class="title">
                {{ item.title }}
                <span v-if="item.status === 1" style="color: #2984f8">
                  已使用
                </span>
                <span v-if="item.status === 2" style="color: green">
                  待审核
                </span>
                <span v-if="item.status === 3" style="color: #fddb78">
                  已停用
                </span>
                <span v-if="item.status === 4" style="color: #fa746b">
                  已驳回
                </span>
              </div>
              <div class="user">服务人群：{{ item.user }}</div>
              <div class="label">
                <div
                  v-for="(span, index) in item.label"
                  :key="index"
                  class="left"
                >
                  <span
                    v-if="span === '随访服务'"
                    style="
                      display: block;
                      background: #fee3e1;
                      height: 100%;
                      width: 100%;
                      color: #fa746b;
                    "
                    >随访服务</span
                  >
                  <span
                    v-if="span === '常规护理'"
                    style="
                      display: block;
                      background: #d8f6ed;
                      height: 100%;
                      width: 100%;
                      color: #6adacb;
                    "
                    >常规护理</span
                  >
                  <span
                    v-if="span === '中医护理'"
                    style="
                      display: block;
                      background: #e2e4fd;
                      height: 100%;
                      width: 100%;
                      color: #6c76f4;
                    "
                    >中医护理</span
                  >
                  <span
                    v-if="span === '慢病管理'"
                    style="
                      display: block;
                      background: #fa746b;
                      height: 100%;
                      width: 100%;
                      color: #fa746b;
                    "
                    >慢病管理</span
                  >
                  <span
                    v-if="span === '儿童护理'"
                    style="
                      display: block;
                      background: #fff8e4;
                      height: 100%;
                      width: 100%;
                      color: #fddb78;
                    "
                    >儿童护理</span
                  >
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script >
export default {
  name: "ServicePackManagement",
  data() {
    return {
      value: "",
      input4: "",
      options: [
        {
          value: "全部",
          label: "全部",
        },
        {
          value: "待审核",
          label: "待审核",
        },
        {
          value: "使用中",
          label: "使用中",
        },
        {
          value: "已驳回",
          label: "已驳回",
        },
        {
          value: "已停用",
          label: "已停用",
        },
      ],
      servicePackage: [
        {
          title: "基础包",
          level: "初级包",
          user: "所有人",
          status: 1,
          label: ["常规护理", "儿童护理"],
        },
        {
          title: "基础包",
          level: "初级包",
          user: "所有人",
          status: 1,
          label: ["常规护理", "儿童护理"],
        },
        {
          title: "基础包",
          level: "初级包",
          user: "所有人",
          status: 1,
          label: ["常规护理", "儿童护理"],
        },
        {
          title: "基础包",
          level: "初级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "基础包",
          level: "初级包",
          user: "所有人",
          status: 3,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 1,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 3,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "老人服务包",
          level: "中级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "儿童服务包",
          level: "高级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "儿童服务包",
          level: "高级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "儿童服务包",
          level: "高级包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "定制包",
          level: "特需定制包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "定制包",
          level: "特需定制包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "定制包",
          level: "特需定制包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
        {
          title: "定制包",
          level: "特需定制包",
          user: "所有人",
          status: 2,
          label: ["随访服务", "中医护理"],
        },
      ],
    };
  },
  computed: {
    smallPackage() {
      return this.servicePackage.filter((item) => item.level === "初级包");
    },
    middlePackage() {
      return this.servicePackage.filter((item) => item.level === "中级包");
    },
    seniorPackage() {
      return this.servicePackage.filter((item) => item.level === "高级包");
    },
    specialPackage() {
      return this.servicePackage.filter((item) => item.level === "特需定制包");
    },
  },
  methods: {
    toNewAddServicePackage() {
      this.$router.push('/data-management/new-add-service-package')
    }
  },
};
</script>

<style lang="less" scoped>
// 清浮动
.clearfix::after {
  display: block;
  content: "";
  clear: both;
  height: 0;
}
// 左浮动
.left {
  float: left;
}
.right {
  float: right;
}
// .top {
//   width: 100%;
//   height: 40px;
//   display: flex;
//   justify-content: flex-start;
//   align-items: center;
//   font-size: 22px;
//   margin-top: 10px;
//   .blue {
//     width: 6px;
//     height: 26px;
//     border-radius: 10px;
//     background: blue;
//     margin: 0 10px;
//   }
// }
.top {
  padding: 10px;
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 22px;
  margin-top: 10px;
  div {
    width: 5px;
    height: 25px;
    background: blue;
    border-radius: 5px;
    margin-right: 10px;
  }
}
.service-pack-management {
  width: 600px;
}
.xia_la {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
  width: 100%;
  margin-top: 20px;
  .el-input__inner {
    width: 400px;
  }
  div {
    float: left;
  }
  .span {
    float: left;
    line-height: 50px;
    font-size: 18px;
  }
}
// 初级包
.the_primary_package {
  width: 100%;
  .container {
    line-height: 150px;
    .h1 {
      float: left;
      height: 100px;
      font-size: 20px;
      text-align: left;
      width: 100%;
    }
    .sun {
      width: 355px;
      height: 150px;
      margin-left: 20px;
      margin-top: 20px;
      float: left;
      &:hover {
        background: #f2f7fb;
      }
    }
    img {
      width: 145px;
      height: 100px;
      float: left;
      margin: 21px 0 0 10px;
    }
    .card_container {
      width: 175px;
      height: 100px;
      margin: 21px 0 0 10px;
      float: left;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      div {
        width: 100%;
        height: 30px;
        line-height: 30px;
        text-align: left;
      }
      .title {
        font-size: 20px;
        color: #333333;
        span {
          float: right;
          font-size: 12px;
        }
      }
      .label {
        display: flex;
        div {
          text-align: center;
          overflow: hidden;
          height: 26px;
          margin-right: 6px;
          font-size: 12px;
          padding: 10px;
        }
      }
    }
  }
}
</style>
